package com.cxx.purchasecharge.core.model.persistence;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import com.cxx.purchasecharge.core.model.BaseModel;

/**
 * 工程
 */
@Entity
@Table (name = "pc_project")
public class Project extends BaseModel
{
    private static final long serialVersionUID = 1L;

    private long id;
    private String name;
    private Date start;
    private Date end;
    private String comment;
    /**
     * 施工费
     */
    private float constructionFee;
    /**
     * 设备费
     */
    private float equipmentFee;
    /**
     * 交易金
     */
    private float dealMoney;

    /**
     * 负责人
     */
    private long signUser;
    private long userCreatedBy;
    private long userUpdatedBy;
    private Contract contract;
    
    public Project () {}

    @Id
    @GeneratedValue (strategy = GenerationType.AUTO)
    public long getId ()
    {
        return id;
    }

    public void setId (long id)
    {
        this.id = id;
    }

    @Column (nullable = false, unique = true)
    public String getName ()
    {
        return name;
    }

    public void setName (String name)
    {
        this.name = name;
    }

    @Column (nullable = false)
    public Date getStart ()
    {
        return start;
    }

    public void setStart (Date start)
    {
        this.start = start;
    }

    public Date getEnd ()
    {
        return end;
    }

    public void setEnd (Date end)
    {
        this.end = end;
    }

    @Column (length = 2048)
    public String getComment ()
    {
        return comment;
    }

    public void setComment (String comment)
    {
        this.comment = comment;
    }

    public float getConstructionFee ()
    {
        return constructionFee;
    }

    public void setConstructionFee (float constructionFee)
    {
        this.constructionFee = constructionFee;
    }

    @Column (nullable = false)
    public long getSignUser ()
    {
        return signUser;
    }

    public void setSignUser (long signUser)
    {
        this.signUser = signUser;
    }

    @Column (nullable = false)
    public long getUserCreatedBy()
    {
        return userCreatedBy;
    }

    public void setUserCreatedBy(long userCreatedBy)
    {
        this.userCreatedBy = userCreatedBy;
    }

    @Column (nullable = false)
    public long getUserUpdatedBy()
    {
        return userUpdatedBy;
    }

    public void setUserUpdatedBy(long userUpdatedBy)
    {
        this.userUpdatedBy = userUpdatedBy;
    }

    public float getEquipmentFee ()
    {
        return equipmentFee;
    }

    public void setEquipmentFee (float equipmentFee)
    {
        this.equipmentFee = equipmentFee;
    }

    public float getDealMoney ()
    {
        return dealMoney;
    }

    public void setDealMoney (float dealMoney)
    {
        this.dealMoney = dealMoney;
    }

    @OneToOne
    @JoinColumn (name = "contract_id")
    public Contract getContract ()
    {
        return contract;
    }

    public void setContract (Contract contract)
    {
        this.contract = contract;
    }
}
